#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/delay.h>

#define    HELLO_MAJOR     231
#define    DEVICE_NAME     "HelloModule"

static int hello_open(struct inode *inode, struct file *file){
    printk(KERN_EMERG "hello open.\n");
    return 0;
}


static struct file_operations hello_flops = {
    .owner=THIS_MODULE,
    .open=hello_open,     
};


static int __init fpga_init(void) 
{	
   int ret;
    
    ret = register_chrdev(HELLO_MAJOR,DEVICE_NAME, &hello_flops);
    if (ret < 0) {
      printk(KERN_EMERG DEVICE_NAME " can't register major number.\n");
      return ret;
    }
    printk(KERN_EMERG DEVICE_NAME " initialized.\n");
    return 0;

}

static void __exit fpga_exit(void)
{

printk("2-------------------------riffa fpga_exit hello world bye------------------------\n");
}

module_init(fpga_init);
module_exit(fpga_exit);

MODULE_LICENSE("GPL");
